<link rel="stylesheet" media="screen" type="text/css" title="fiche_Css" href="_css/fiche2.css" />
<link rel="stylesheet" type="text/css" href="_js/grid/gt_grid.css" />
<link rel="stylesheet" type="text/css" href="_js/grid/skin/vista/skinstyle.css" />
<script type="text/javascript" src="_js/grid/gt_msg_en.js"></script>
<script type="text/javascript" src="_js/grid/gt_grid_all.js"></script>
<script type="text/javascript" src="_js/grid/flashchart/fusioncharts/FusionCharts.js"></script>
<script type="text/javascript" src="_js/grid/calendar/calendar.js"></script>
<script type="text/javascript" src="_js/grid/calendar/calendar-setup.js"></script> 
<script type="text/javascript" >

var grid_demo_id = "myGrid1" ;


var dsOption= {

	fields :[
		{name : 'Id_palette'  },
		{name : 'Id_ordre_preparation'  },
		{name : 'Emplacement' },
				],
	recordType : 'array'
}



var colsOption = [
     {id: 'Id_palette' , header: "Palette" , width :60  },
     {id: 'Id_ordre_preparation' , header: "Ordre de preparation" , width :140  },
	 {id: 'Emplacement' , header: "Emplacement" , width :90},
];


var gridOption={
	id : grid_demo_id,
	loadURL : "_fct/Entrepot/ShowComController.php",
	width: 295,//"100%", // 700,
	height: 200,//"100%", // 330,
	container : 'gridbox', 
	replaceContainer : true, 
	encoding : 'UTF-8', // Sigma.$encoding(), 
	dataset : dsOption ,
	columns : colsOption ,
	skin: "vista",
	pageSize:100,
	toolbarContent : 'reload',
	parameters : {'idcom':"<?php echo $_GET['idcom']; ?>"},
};


var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad(function(){mygrid.render()});

//////////////////////////////////////////////////////////

</script>
	<div id='top'>Fiche de la commande N&#176; <?php echo $res_com['Id_Commande']; ?></div>
	<table id="refs">
		<tr>
		<th>Nom du client : </th> <td><?php echo $res_com['Raison_Social']; ?></td>
		<th>GLN_Client : </th> <td><?php echo $res_com['GLN_Client']; ?></td>
		</tr>
		<tr>
		<th>Industriel : </th> <td><?php echo $res_com['us_nom']; ?></td>
		<th>GLN DO : </th> <td><?php echo $res_com['GLN_DO']; ?></td>
		</tr>
		<tr>
		<th>Entrepot : </th> <td><?php echo $res_com['en_nom']; ?></td>
		<th>GLN Entrepot : </th> <td><?php echo $res_com['GLN_Entrepot']; ?></td>
		</tr>
		</table>
	<p id="description" ><strong>Description de l'ordre de preparation :</strong><br/> <?php echo $res_pre['Description']?></p>
	<center>
		<div id="bigbox">
      		<div id="gridbox"></div>
    	</div>
    <?php
    	if (isset($_GET['idpal']) && !empty($_GET['idpal']))
    	{ ?>
    <table id="colis" border='1'>
    <tr>
    	<th>Colis de la palette <?php echo $_GET['idpal']; ?></th>
    	<th>Quantite</th>
    </tr>
    <?php
    foreach($array AS $colis)
    { ?>
    <tr>
    <td><?php echo $colis['Id_colis']; ?></td>
    <td><?php echo $colis['Quantite']; ?></td>
    </tr>
    <?php } ?>
    </table>
    <?php } ?>
    </center>
    <br />
    <table id="stats"'>
		<tr>
		<th>Début de commande : </th><td><?php echo $res_com['Date_Commande']; ?></td>
		<th>Livraison commande : </th><td><?php echo $res_com['Date_fin_Liv']; ?></td>
		</tr>
		<tr>
		<th>Etat commande : </th><td><?php echo $etat_val ?> 
		<?php if ($res_com['Etat'] == 'p') { ?>
	    <a href="<?php echo ROOT; ?>?page=Entrepot/Commande&fct=Entrepot/CommandeAction&id=<?php echo $res_com['Id_Commande']; ?>&action=Valider"><img src="_gfx/icons/accept.png"  alt="404" border="0" title="Annuler"/></a>
	    <?php } 
	    else if ($res_com['Etat'] == 's') { ?>
	    <a href="javascript:;" onClick="window.open('<?php echo ABS_PATH.ROOT; ?>?page=Entrepot/Couts&id=<?php echo $res_com['Id_Commande']; ?>', 'popuppage', 'width=500,height=200,top=100,left=100');"><img src='_gfx/icons/accept.png'  alt='404' border='0' title='Valider'/></a>
	    <?php } ?></td>
		<th>Debut ordre preparation : </th><td><?php echo $res_pre['Date_diffusion_ordre_prepa']; ?></td>
		<tr>
		</tr>
		<th>Fin de prepartion : </th><td><?php echo $res_pre['Date_fin']; ?></td>
		<th>Montant : </th><td><?php echo $res_com['Montant']; ?> &#128;</td>
		</tr>
		<tr>
		<th>Couts entrepot : </th><td><?php echo $res_cout['tot_entrepot']; ?></td>
		<th>Couts livraison : </th><td><?php echo $res_cout['Couts_livraison']; ?></td>
		</tr>
	</table>
	    <div id="chrono">
	<?php include_once('_tpl/chrono.php'); ?>
	</div>